/*
 * @Author: HeAo
 * @Date: 2021-09-27 09:06:28
 * @LastEditTime: 2021-09-27 09:26:09
 * @LastEditors: HeAo
 * @Description:
 * @FilePath: \web2103-2105\web2103code\3-1-ES6\day03\1-函数参数.js
 * 别乱动！
 */

let myFun1 = function (a, b, c = 10) {
  console.log(a, b, c);
  console.log(arguments);
}

myFun1(null, 2)

let myfun2 = function ({ a, b, c = 100 }) {
  console.log(a, b, c);
}
// let { a, b, c } = { a: 1, c: 2, b: 'tom' }
myfun2({ b: 1, c: 2, a: 'tom' })

let myFun3 = function ([a, b, c]) {
  console.log(a, b, c);
}
myFun3([, 2, 3])

// ...用在函数形参位置，叫做rest参数，也叫拓展运算符的逆运算
let myFun4 = function (a, ...b) {
  console.log(a, b);
}
myFun4(1, 2, 3, 4, 5, 6)

